<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
     
    </style>
    <script src="/公开课/JS/vue.min.js"></script>
  </head>
  <body>
    <!-- vue只控制div -->
    <div id="app">
   
    </div>
    <!-- const定义常量的 -->
    <script>
      let vue = new Vue({
        el: "#app",
        data: { number : 10 },
        beforeCreate: function(){
          //创建之前
            alert(this.number) //创建之前 undefinded number还没被初始化
          },
          created: function(){
            //创建Vue实例后，number已经被赋值，可以调用
            alert(this.number)
          }
        
      });
    </script>
  </body>
</html>
